<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select($event)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref='multipleTable' :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.emitempl.main2_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type='selection' :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('emitemplid')">
                <el-table-column show-overflow-tooltip :prop="'emitemplid'" :label="$t('entities.emitempl.main2_grid.columns.emitemplid')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.emitemplid')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.emitemplid}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('inoutflag')">
                <el-table-column show-overflow-tooltip :prop="'inoutflag'" :label="$t('entities.emitempl.main2_grid.columns.inoutflag')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.inoutflag')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.inoutflag" tag='EMINOUTFLAG' codelistType='STATIC' ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('itemname')">
                <el-table-column show-overflow-tooltip :prop="'itemname'" :label="$t('entities.emitempl.main2_grid.columns.itemname')" :width="250"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.itemname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emitem' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emitem-tab-exp-view', height: 0,width: 0,title: $t('entities.emitem.views.tabexpview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            { pathName: 'emservices', parameterName: 'emservice' },
            ]
            ,parameters: [
            { pathName: 'emitems', parameterName: 'emitem' },
            { pathName: 'tabexpview', parameterName: 'tabexpview' }
            ]}" valueitem="itemid">
                            <span>{{row.itemname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('sdate')">
                <el-table-column show-overflow-tooltip :prop="'sdate'" :label="$t('entities.emitempl.main2_grid.columns.sdate')" :width="130"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.sdate')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-format-data format="YYYY-MM-DD HH:mm:ss" :data="row.sdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('storename')">
                <el-table-column show-overflow-tooltip :prop="'storename'" :label="$t('entities.emitempl.main2_grid.columns.storename')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.storename')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emstore' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emstoreedit-view', height: 0,width: 0,title: $t('entities.emstore.views.editview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'emstores', parameterName: 'emstore' },
            { pathName: 'editview', parameterName: 'editview' }
            ]}" valueitem="storeid">
                            <span>{{row.storename}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('storepartname')">
                <el-table-column show-overflow-tooltip :prop="'storepartname'" :label="$t('entities.emitempl.main2_grid.columns.storepartname')" :width="160"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.storepartname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link deKeyField='emstorepart' :context="JSON.parse(JSON.stringify(context))" :viewparams="JSON.parse(JSON.stringify(viewparams))" :data="row" :linkview="{viewname: 'emstorepartedit-view-9836', height: 0,width: 1000,title: $t('entities.emstorepart.views.editview_9836.title'),placement: 'DRAWER_RIGHT', isRedirectView: false,deResParameters: [
            { pathName: 'emstores', parameterName: 'emstore' },
            ]
            ,parameters: [
            { pathName: 'emstoreparts', parameterName: 'emstorepart' },
            { pathName: 'editview_9836', parameterName: 'editview_9836' }
            ]}" valueitem="storepartid">
                            <span>{{row.storepartname}}</span>
                        </app-column-link >
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('psum')">
                <el-table-column show-overflow-tooltip :prop="'psum'" :label="$t('entities.emitempl.main2_grid.columns.psum')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.psum')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="FLOAT" precision="0" :data="row.psum"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('price')">
                <el-table-column show-overflow-tooltip :prop="'price'" :label="$t('entities.emitempl.main2_grid.columns.price')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.price')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.price"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('amount')">
                <el-table-column show-overflow-tooltip :prop="'amount'" :label="$t('entities.emitempl.main2_grid.columns.amount')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.amount')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data dataType="CURRENCY" precision="0" :data="row.amount"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('batcode')">
                <el-table-column show-overflow-tooltip :prop="'batcode'" :label="$t('entities.emitempl.main2_grid.columns.batcode')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.batcode')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.batcode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('sempname')">
                <el-table-column show-overflow-tooltip :prop="'sempname'" :label="$t('entities.emitempl.main2_grid.columns.sempname')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                      <span class="column-header ">
                        {{$t('entities.emitempl.main2_grid.columns.sempname')}}
                      </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <span>{{row.sempname}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class='grid-pagination' v-show="items.length > 0">
            <page class='pull-right' @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>